package com.coolw.design.pattern.behavior.iterator;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Iterator;

/**
 * 迭代器模式测试类
 *
 * @author coolw
 * @date 2025/4/3 14:05
 */
public class IteratorTest {

    public static void main(String[] args) {
        OrderList orderList = new OrderList();
        orderList.add(new Order("1", new BigDecimal("10"), new Date()));
        orderList.add(new Order("2", new BigDecimal("20"), new Date()));
        orderList.add(new Order("3", new BigDecimal("30"), new Date()));

        Iterator<Order> iterator = orderList.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
